<?php
class HTML_bpnews
{
	function showNews( $rows, $option )
	{
		?>
		<table>
		<?php 
		foreach($rows as $row)
		{
			$link = JRoute::_('index.php?option='. $option. '&id=' . $row->id . '&task=view' );
			echo
			'<tr>
				<td>
					<a href = "'.$link.'">'.$row->title.'</a>
				</td>
			 </tr>';
		}
		?>
		</table>
		<?php
	}
	
	// @TODO Add a column to the database that allows an optional url for outside news sources
	function showNewsItem( $row, $option )
	{
		?>
		<p class = "contentheading"><?php echo $row->title; ?></p>
		<p class = "date"><?php echo JHTML::Date( $row->created ); ?></p>
		<p class = "text"><?php echo $row->text; ?></p>
		<?php $link = JRoute::_('index.php?option=' . $option ); ?>
		<a href = "<?php echo $link; ?>">&lt; Return to BookPeople News</a>
		<?php
	}
}
?>